package cn.edu.nuaa.springmvc.controller;

import cn.edu.nuaa.springmvc.model.User;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping(value = "/user")
public class UserController {
    @RequestMapping(value = "/test01")
    public void userTest01(@RequestBody User user) {
        System.out.println(user);
    }

    @RequestMapping(value = "/test02")
    public void userTest02(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date) {
        System.out.println(date);
    }
}
